{include file="header.html"}
<div id="rightTop">
    <p>{$lang.ad}</p>
    <ul class="subnav">
        <li><span>{$lang.manage}</span></li>
        <li><a class="btn1" href="index.php?app=ad&amp;act=add">{$lang.add}</a></li>
    </ul>
</div>
<div class="mrightTop">
    <div class="fontl">
        <form method="get">
            <div class="left">
                <input type="hidden" name="app" value="ad" />
                <input type="hidden" name="act" value="index" />
                {$lang.ad_name}:
                <input class="queryInput" type="text" name="ad_name" value="{$query.ad_name|escape}" />
                <select class="querySelect" name="ad_type">
                    <option value="">{$lang.search_ad_type}</option>
                    {html_options options=$ad_type_list selected=$smarty.get.ad_type}
                </select>
                <input type="submit" class="formbtn" value="{$lang.query}" />
            </div>
            <!--{if $filtered}-->
            <a class="left formbtn1" href="index.php?app=ad&wait_verify={$wait_verify}">{$lang.cancel_query}</a>
            <!--{/if}-->
        </form>
    </div>
    <div class="fontr">
        {if $ads}{include file=page.top.html}{/if}
    </div>
</div>
<div class="tdare">
    <table width="100%" cellspacing="0" class="dataTable">
        <!--{if $ads}-->
        <tr class="tatr1">
            <td width="20" class="firstCell"><input type="checkbox" class="checkall" /></td>
            <td class="align_center" width="20%"><span ectype="order_by" fieldname="ad_name">{$lang.ad_name}</span></td>
            <td class="align_center" width="20%">{$lang.ad_link}</td>
            <td class="align_center" width="10%"><span ectype="order_by" fieldname="ad_type">{$lang.ad_type}</span></td>
            <td class="align_center" width="10%"><span ectype="order_by" fieldname="if_show">{$lang.if_show}</span></td>
            <td class="align_center" width="10%"><span ectype="order_by" fieldname="sort_order">{$lang.sort_order}</span></td>
            <td class="align_center" width="10%">{$lang.ad_logo}</td>
            <td class="handler" width="10%">{$lang.handler}</td>
        </tr>
        <!--{/if}-->
        <!--{foreach from=$ads item=ad}-->
        <tr class="tatr2">
            <td class="firstCell"><input value="{$ad.ad_id}" class='checkitem' type="checkbox" /></td>
            <td><span ectype="inline_edit" fieldname="ad_name" fieldid="{$ad.ad_id}" required="1" class="editable" title="{$lang.editable}">{$ad.ad_name|escape}</span></td>
            <td><span ectype="inline_edit" fieldname="ad_link" fieldid="{$ad.ad_id}" required="1" class="editable" title="{$lang.editable}">{$ad.ad_link|escape}</span></td>
            <td>{$ad.ad_type}</td>
            <td><!--{if $ad.if_show}--><img src="templates/style/images/positive_enabled.gif" ectype="inline_edit" fieldname="if_show" fieldid="{$ad.ad_id}" fieldvalue="1" title="{$lang.editable}"/><!--{else}--><img src="templates/style/images/positive_disabled.gif" ectype="inline_edit" fieldname="if_show" fieldid="{$ad.ad_id}" fieldvalue="0" title="{$lang.editable}"/><!--{/if}--></td>
            <td><span ectype="inline_edit" fieldname="sort_order" fieldid="{$ad.ad_id}" datatype="pint" maxvalue="255" class="editable" title="{$lang.editable}">{$ad.sort_order}</span></td>  
            <td>{if $ad.ad_logo}<img src="{$ad.ad_logo}?{$random_number}" height="30"/>{/if}</td>
            <td class="handler">
                <a href="index.php?app=ad&amp;act=edit&amp;id={$ad.ad_id}">{$lang.edit}</a>  |  
                <a name="drop" href="javascript:drop_confirm('{$lang.drop_confirm}', 'index.php?app=ad&amp;act=drop&amp;id={$ad.ad_id}');">{$lang.drop}</a>
            </td>
        </tr>
        <!--{foreachelse}-->
        <tr class="no_data">
            <td colspan="7">{$lang.no_data}</td>
        </tr>
        <!--{/foreach}-->
    </table>
    <!--{if $ads}-->
    <div id="dataFuncs">
        <div id="batchAction" class="left paddingT15">
            &nbsp;&nbsp;
            <input class="formbtn batchButton" type="button" value="{$lang.drop}" name="id" uri="index.php?app=ad&act=drop" presubmit="confirm('{$lang.drop_confirm}');" />
        </div>
        <div class="pageLinks">
            {if $ads}{include file=page.bottom.html}{/if}
        </div>
    </div>
    <!--{/if}-->
    <div class="clear"></div>
</div>
{include file="footer.html"}
